package com.itheima.config;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

@Configuration

public class ServletConfig extends AbstractAnnotationConfigDispatcherServletInitializer//代替web.xml，必须重写三个类
{
    @Override
    protected Class<?>[] getRootConfigClasses()//配置spring容器的根配置类
    {
        return new Class[]{SpringConfig.class};
    }

    @Override
    protected Class<?>[] getServletConfigClasses()//配置springMvc的配置类
    {
        return new Class[]{SpringMvcConfig.class};
    }

    @Override
    protected String[] getServletMappings()//设置哪些请求被servlet接收
    {
        return new String[]{"/"};
    }



}
